import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

//字体大小自适应工具类
class MonitorUtil{

  //默认取iPhone6的尺寸(750*1334)
  static init(BuildContext context, {num width = 750, num height = 1334}){
    //设置字体大小根据系统的“字体大小”辅助选项来进行缩放
    ScreenUtil.init(context, width: width, height: height,allowFontScaling: true);
    print('像素密度:${ScreenUtil.pixelRatio}');
    print('像素高度:${ScreenUtil.screenHeight}');
    print('像素宽度:${ScreenUtil.screenWidth}');
  }
}